package com.eapi.project.controller;

import com.eapi.project.common.ResultUtils;
import com.eapi.project.common.BaseResponse;
import com.eapi.project.model.dto.mail.MailRequest;
import com.eapi.project.service.SendMailService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/send-mail")
@Api(value = "发送邮件接口",tags = {"发送邮件接口"})
public class SendMailController {
    @Autowired
    private SendMailService sendMailService;

    @PostMapping("/simple")
    public BaseResponse<String> SendSimpleMessage(@RequestBody MailRequest mailRequest) {
        sendMailService.checkMail(mailRequest);
        sendMailService.sendSimpleMail(mailRequest);
        return ResultUtils.success("发送成功");
    }

/*    @PostMapping("/html")
    public BaseResponse<String> SendHtmlMessage(@RequestBody MailRequest mailRequest) {
        sendMailService.sendHtmlMail(mailRequest);
        return ResultUtils.success("发送成功");
    }*/
}
